#include<iostream>
#include<string>
using namespace std;
int main()
{
	string s1;
	string s2;
	cin >> s1;
	auto p1 = s1.begin();
	auto p2 = p1;
	for (int i = 1; i<s1.size(); i++)
	{
		if (s1[i] != s1[i - 1] || i == s1.size() - 1)
		{
			int t = p2 - p1 - 1;
			if (t)
				s2 += ('0' + t);
			s2 += s1[i - 1];
			p1 = p2;

		}
		else
			p2++;
	}
	cout << s2;
}